import request from '../utils/request.js'

//文章列表查询
export const articleListService = (params)=>{
    return  request.get('/admin/articlelist',{params:params})
}

//用户列表查询
export const userListService = (params) => {

    return request.get('/admin/userlist',{params:params})

}

//评论列表查询
export const commentListService = (params) => {

    return request.get('/admin/commentlist',{params:params})

}

//查看文章内容
export const articleDetailsService = (id) => {

    return request.get('/admin/articlecontent?id='+id)

}

//审核文章
export const articleAuditService = (audit) => {

    const params = new URLSearchParams()
    params.append("id",audit.value.id)
    params.append("message",audit.value.message)
    params.append("status",audit.value.status)

    return request.patch('/admin/audit',params)

}

//删除用户
export const deleteUserService = (id) => {

    return request.delete('/admin/userdelete?id='+id)

}

//删除评论
export const deleteCommentService = (id) => {

    return request.delete('/admin/commentdelete?id='+id)

}